// router/index.ts

import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router';

const routes: RouteRecordRaw[] = [
  { path: '/', redirect: '/login' },
  // Define your routes here
  {
    path: '/upload',
    name: 'upload',
    component: () => import('@/views/upload.vue'),
    meta: { requiresAuth: true }, // 自定义元信息，用于权限控制等
  },
  {
    path: '/login',
    name: 'login',
    component: () => import('@/views/login.vue'),
  },
];
//自定义
// import { MyCustomRoutes } from './my-custom-routes'; // 假设从外部导入了自定义路由配置
// const routes = MyCustomRoutes as any[]; // 使用类型断言告诉 TypeScript 变量的类型

const router = createRouter({
  // history: createWebHistory(),
  history: createWebHashHistory(),
  routes,
});

export default router;
